<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li>
				<i class="icon-home home-icon"></i>
				<a href="#">系统首页</a>
			</li>
			<li class="active">
				信息互动
			</li>
            <li class="active">
				通知公告
			</li>
		</ul><!-- .breadcrumb -->
	</div>
	<!-- Main content -->
    <div class="page-content">
    	<div class="row">
    	    <div class="page-header">
    			<h1>通知公告信息表</h1>
    		</div>
    		<div class="col-xs-12">
            	<a class="btn btn-info btn-sm" href="<?php echo base_url()."admin/message/add_message_notice"?>"><i class="icon-copy"></i>新增</a>
                <a href="javascript:void(0)" onclick="delSomeModal()" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>删除</a>
            </div>
            <div class="col-md-12 col-sm-12 col-xs-12 form">
                <div class="row">
                <form action="<?php echo base_url().'admin/message/query_message_notice'?>" method="get">
                	<div class="wh">
                    	<label>标题：</label>
                        <input type="text"  name="title" value="<?php if (isset($title))echo $title;?>"/>
                    </div>
                    <div class="wh">
                    	<label>公告类型：</label>
                        <select name="type" id="type">
                            <option value="">全部</option>
                            <option value="1" <?php if (isset($type)&&$type == 1)echo "selected";?>>行政公告</option>
                            <option value="2" <?php if (isset($type)&&$type == 2)echo "selected";?>>系统通知</option>
						</select>
					</div>
					<div class="wh">
                    	<label>发布人：</label>
                        <input type="text"  name="admin_name" value="<?php if (isset($admin_name))echo $admin_name;?>"/>
                    </div>
                    <div class="wh">
						<button class="btn btn-sm btn-info" type="submit"><i class="icon-search"></i>查询</button>
                    </div>
                </form>
                </div>
			</div>
			<div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
				<form action="<?php echo base_url()."admin/message/del_some_message_notice"?>" method="post" id="delForm">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center" style="width: 3%;">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>标题</th>
								<th>发布部门</th>
                                <th>发布人</th>
                                <th>发布时间</th>
                                <th style="width: 15%;">操作</th>
							</tr>
						</thead>
						<tbody>
						<?php if (isset($result)&&count($result)>0){
                            	foreach ($result as $notice){
                            	?>
							<tr>
								<td class="center">
                                	<p>
									<label>
										<input type="checkbox" class="ace" name="num[]" value="<?php echo $notice->id;?>"/>
										<span class="lbl"></span>
									</label>
                                    </p>
								</td>
								<td><p><?php echo $notice->title;?></p></td>
								<td><p><?php echo $notice->department_name;?></p></td>
								<td><p><?php echo $notice->admin_name;?></p></td>
								<td><p><?php echo $notice->create_time;?></p></td>
								<td><p>
								    <a class="btn btn-sm btn-info" href="<?php echo base_url().'admin/message/edit_message_notice/'.$notice->id;?>"><i class="icon-edit"></i>编辑</a>
                                    <a href="javascript:void(0)" onclick="delmodal('<?php echo $notice->id;?>')" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>删除</a>
                                    </p>
                                </td>
                                </tr>
    						<?php }
                            }else{?>
                            <tr>
                            	<td colspan="6">无数据</td>
                            </tr>
                            <?php }?>
                            </tbody>
                         </table>
                     </form>
                     </div><!-- /.table-responsive -->
	            </div>
	            <div class="col-sm-12">
                	<div class="modal-footer no-margin-top">
	                	<div class="pull-left record">
							共<?php echo $count;?>条记录
	                    </div>
                		<?php if (isset($page))echo $page;?>
                	</div>
                </div>
            </div><!-- /.row -->
		</div><!-- /.page-content -->
	</div><!-- /.main-content -->
	<div id="delModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p>确定要删除该公告吗？</p>
				</div>
				<div class="modal-footer">
				  <a id="delbtn" href="#" class="btn btn-danger">确定</a>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
	
	<div id="delsomeModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p>确定要删除所选公告吗？</p>
				</div>
				<div class="modal-footer">
				  <button id="delsomebtn" type="submit" class="btn btn-danger">确定</button>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
	function delmodal(id){
		$("#delbtn").attr('href','<?php echo base_url().'admin/message/del_message_notice/'?>'+id);
	    $('#delModal').modal('show');
	}
	function delSomeModal(){
		if(checkSelect()){
	    	$('#delsomeModal').modal('show');
		}else{
			alert('请选择正确的记录进行删除');
		}
	}
	$("#delsomebtn").click(function(){
		$("#delForm").submit();
    });

	</script>